* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: #f7f7f2; /* 米白 */
  color: #1a1a1a;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 亮色主题覆盖 */
/* 回滚：移除亮色主题覆盖 */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f7f7f2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.06);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  font-size: 16px;
  opacity: 0.8;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

/* 回滚：移除亮色主题覆盖 */

.logo-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

#header-logo {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* 头部区域中的图标按钮适配深色渐变 */
.header .icon-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.icon-btn:active {
  transform: translateY(0);
}

.content {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #faf9f5 0%, #f4f2ed 100%);
}

.search-bar {
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.search-bar form {
  display: flex;
  gap: 10px;
}

#search-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #ffffff;
  color: #1a1a1a;
  outline: none;
}

/* 回滚：移除亮色主题覆盖 */

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.list-container {
  position: absolute;
  top: 70px;
  bottom: 80px; /* 预留底部播放器栏 + 更紧凑的安全间距 */
  left: 0;
  right: 0;
  overflow: auto;
  padding: 10px 20px;
  background: transparent;
}

/* 空态：弱化的音乐符号作为整体背景水印 */
.list-container.empty {
  position: absolute;
}

.list-container.empty::before {
  content: "♪";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 120px;
  line-height: 1;
  color: #8a7ff3;
  opacity: 0.08; /* 弱化，与背景融合 */
  pointer-events: none;
}

/* 空态时隐藏原来的文字卡片 */
.list-container.empty .list-empty {
  display: none !important;
}

.list-empty, .list-loading, .list-error {
  text-align: center;
  opacity: 0.7;
  margin-top: 40px;
}

/* 空状态美化：在没有任何歌曲时的卡片提示 */
.list-empty {
  width: 100%;
  max-width: 560px;
  margin: 80px auto 0;
  background: #ffffff;
  color: #4a4a4a;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 22px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  opacity: 1; /* 覆盖通用的 0.7，更清晰可读 */
}

.list-empty::before {
  content: "♪";
  display: block;
  font-size: 26px;
  line-height: 1;
  color: #8a7ff3;
  margin-bottom: 10px;
  opacity: 0.85;
}

/* 翻页加载的转圈圈指示 */
.list-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(0, 0, 0, 0.68);
  margin-top: 8px;
  padding: 6px 12px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
}

.list-loading::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #667eea;
  border-right-color: #8a7ff3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 结果列表底部的加载占位项（用于滚动翻页） */
.loading-footer {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px 12px; /* 更紧凑的占位高度 */
  color: rgba(0, 0, 0, 0.68);
}

.loading-footer::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #667eea;
  border-right-color: #8a7ff3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 72px; /* 更紧凑的底部预留 */
}

/* 骨架屏 */
.skeleton-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.skeleton-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(90deg, #efeee9 25%, #e9e7e2 37%, #efeee9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #efeee9 25%, #e9e7e2 37%, #efeee9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line.short {
  width: 60%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.result-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background 0.2s ease;
}

.result-item:hover {
  background: #fafafa;
}

/* 回滚：移除亮色主题覆盖 */

.result-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #f0f0f0;
}

img.result-cover {
  object-fit: cover;
  display: block;
}

.result-cover.no-cover {
  background: linear-gradient(135deg, #eceae6 0%, #f7f6f2 100%);
  border: 1px dashed rgba(0, 0, 0, 0.12);
}

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title {
  font-weight: 600;
}

.subtitle {
  font-size: 12px;
  opacity: 0.7;
}

.duration {
  font-size: 12px;
  opacity: 0.8;
}

.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  padding: 12px 20px;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
}

/* 回滚：移除亮色主题覆盖 */

#audio {
  width: 520px;
  max-width: 54vw;
}

/* 美化内置控件（Chrome） */
#audio::-webkit-media-controls-enclosure {
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}

#audio::-webkit-media-controls-panel {
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#audio::-webkit-media-controls-mute-button,
#audio::-webkit-media-controls-play-button,
#audio::-webkit-media-controls-timeline,
#audio::-webkit-media-controls-volume-slider {
  filter: saturate(0.95) brightness(0.98);
}

#audio::-webkit-media-controls-current-time-display,
#audio::-webkit-media-controls-time-remaining-display {
  color: #1a1a1a;
}

.now-playing {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.unlock-prompt {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

/* 回滚：移除亮色主题覆盖 */

.unlock-modal {
  background: #ffffff;
  padding: 40px 50px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  max-width: 400px;
}

/* 回滚：移除亮色主题覆盖 */

.unlock-modal h2 {
  font-size: 24px;
  margin-bottom: 15px;
  font-weight: 600;
}

.unlock-modal p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
  line-height: 1.6;
}

.btn {
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: #667eea;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  background: #5a62e5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.btn-primary:active {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header {
    padding: 12px 20px;
  }

  .header h1 {
    font-size: 18px;
  }

  .unlock-modal {
    padding: 30px 30px;
    margin: 20px;
  }

  .player-bar {
    height: 60px;
    padding: 10px 14px;
    grid-template-columns: 1fr auto;
  }

  #audio {
    width: 100%;
    max-width: 64vw;
  }

  .list-container {
    bottom: 68px; /* 移动端更紧凑的预留 */
  }

  .result-list {
    padding-bottom: 64px;
  }
}

